package com.chen.back.mapper;

import com.chen.back.entity.Permission;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;
import java.util.Set;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author chen
 * @since 2022-02-24
 */
public interface PermissionMapper extends BaseMapper<Permission> {
    //根据用户名得到所对应的权限名
    Set<String> selectAllPermissionCodeByUsername(String username);

    //根据用户名得到父权限，就是一节菜单
    List<Permission> selectFatherPermissionByUsername(String username);
//根据父权限的id，得到子权限，就是二节菜单
    List<Permission> selectSubPermissionByFatherId(int fatherId);
}
